From cef4294cff4ef0b34912fb719142c3b4174b9b0f Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 9 Nov 2009 08:03:30 +0000 Subject: [PATCH] x86, cpuid: mask TSC invariant bit for PV and HVM domains if migration is not disabled and TSC is not emulated Signed-off-by: Dan Magenheimer Signed-off-by: Keir Fraser --- xen/arch/x86/domain.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 8f600d2925..c851209853 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -2045,6 +2045,15 @@ void domain_cpuid( *ebx = cpuid->ebx; *ecx = cpuid->ecx; *edx = cpuid->edx; + + /* + * Do not advertise host's invariant TSC unless the TSC is + * emulated, or the domain cannot migrate to other hosts. + */ + if ( (input == 0x80000007) && /* Advanced Power Management */ + !d->disable_migrate && !d->arch.vtsc ) + *edx &= ~(1u<<8); /* TSC Invariant */ + return; } } -- 2.30.2